<%@page import="model.Loan"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*, model.Investment, model.Company, model.Account, util.*, org.hibernate.*"%> 
   
<%
    
%>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Emprestimos e Pagamentos do Usuario</title>
</head>
<body>

<div class="bordered" style="overflow: auto">
<h3>Lista de Investimentos</h3>

<%
HibernateUtil.getSession().beginTransaction(); 
Session s = HibernateUtil.getSession();


%>


<%

java.util.List list = s.createCriteria(Company.class).list();

for (int i=0; i<list.size(); i++){
	Company com = (Company) list.get(i);
	%>
	<%=com.getCode()%> --- <a href="operacao.jsp?id=<%=com.getId()%>">Comprar acoes desta companhia</a> <br/>
	<%
	
}
HibernateUtil.getSession().getTransaction().commit();
%> 

</body>
</html>